//
// Created by nicemoe on 2021/8/16.
//

#ifndef BASE_STOCK00_H
#define BASE_STOCK00_H

#include <string>

class Stock {
    //私有
private:
    std::string company;
    long shares;
    double share_val;
    double total_val;

//    void set_tot() {
//        total_val = shares * share_val;
//    }
    void set_tot();
//公有
public:
    Stock();
    Stock(const std::string &co, long n = 0, double pr = 0.0);

    void acquire(const std::string &co, long n, double pr);

    void buy(long num, double price);

    void sell(long num, double price);

    void update(double price);

    void show();
};

#endif //BASE_STOCK00_H
